home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark18.i < prev    next >
Text File  |  1995-04-19  |  1KB  |  63 lines

  1.  
  2. Procedure Spark18;
  3. Const
  4.     max4lines = 40;
  5. Type
  6.     Sp1lines    = Array[1..max4lines] of line;
  7.     Sp1LinesPtr = ^Sp1Lines;
  8.  
  9. Var
  10.     arr    : Sp1LinesPtr;
  11.     cnt1,
  12.     cnt2,
  13.     cnt3,
  14.     CCNT,
  15.     add1,
  16.     add2,
  17.     add3,
  18.     actualline : Short;
  19. Begin
  20.     New(arr);
  21.     ActualLine := 1;
  22.  
  23.  
  24.     cnt1 := 546;    add1 := 17;    { x1 }
  25.     cnt2 := 3;    add2 := 3;    { y1 }
  26.     cnt3 := 197;    add3 := 11;    { x2 }
  27.     CCNT := 2;    { color }
  28.  
  29.     Repeat
  30.       EraseLine( Adr(arr^[actualline]) );
  31.       With arr^[actualline] do begin
  32.         x1 := 170 + XSin^[cnt1] *  6 DIV  5;    { +- max.120 }
  33.         y1 := 110 + Xsin^[cnt2] * 11 DIV 10;    { +- max.110 }
  34.         x2 := 160 + XSin^[cnt3] *  7 DIV  5;    { +- max.140 }
  35.         y2 := 128;
  36.       end;
  37.  
  38.       cnt1 := cnt1 + add1;
  39.       if cnt1>627 then cnt1:= cnt1-628;
  40.  
  41.       cnt2 := cnt2 + add2;
  42.       if cnt2>627 then cnt2:= cnt2-628;
  43.  
  44.       cnt3 := cnt3 + add3;
  45.       if cnt3>627 then cnt3:= cnt3-628;
  46.  
  47.       DrawLine( Adr(arr^[actualline]), CCNT );
  48.  
  49.       inc( CCNT );
  50.       If CCNT > maxColors then CCNT := 2;
  51.  
  52.       inc( actualline );
  53.       If actualline >= max4lines then actualline := 1;
  54.  
  55.     Until LeftMouseButton;
  56.  
  57.     Ciao;
  58.     Dispose(arr);
  59.     SetSColors(Adr(Def_Colors));
  60.  
  61. End;
  62.  
  63.